﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chinaer.Common.Extensions
{
    /// <summary>
    /// 字符串为空则要抛出异常
    /// </summary>
    public static class StringExtensions
    {
        public static void CheckIsNullThrowException(this string str)
        {
            if (string.IsNullOrEmpty(str))
            {
                Chinaer.Core.Helper.ExceptonHelper.ThrowException(str + "为Null");
            }
        }
        /// <summary>
        /// 判断字符串是否是Null
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckIsNotNull(this string str)
        {
            bool flag = false;
            if (string.IsNullOrEmpty(str))
            {
                flag = false;
            }
            else
            {
                flag = true;
            }
            return flag;
        }


    }
}
